//
//  TJBackgroundView.m
//  BaoDian
//
//  Created by mac on 2024/7/17.
//

#import "TJBackgroundView.h"

@implementation TJBackgroundView {
    UIImageView *__weak _imageView;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        self.backgroundColor = UIColor.tj_backgroundColor;
        self.clipsToBounds = YES;
        
        UIImageView *imageView = [UIImageView addToView:self];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.right.offset(0);
        }];
        _imageView = imageView;
    }
    return self;
}

- (void)setImage:(UIImage *)image {
    _image = image;
    _imageView.image = image;
}


@end
